import Vue from 'vue'
import http from './http'

Vue.prototype.$http = {
  async getSwipe (params) {
    return http.get('/api/getlunbo', params)
  },
  async getFunc (params) {
    return http.get('/api/grids', params)
  },
  async getNewsList (params) {
    return http.get('/api/getnewslist', params)
  },
  async getNewsInfo (params) {
    return http.get('/api/getnew/' + params)
  },
  async getRemarks (params, page) {
    return http.get(`/api/getcomments/${params}?pageindex=${page.index}&limit=${page.limit}`)
  },
  async submitRemake (params, data) {
    return http.post('/api/postcomment/' + params, data)
  },
  async getClassList (params) {
    return http.get('/api/getimgcategory')
  },
  async getImg (params) {
    return http.get('/api/getimages/' + params)
  },
  async getPicDetail (params) {
    return http.get('/api/getimageInfo/' + params)
  },
  async getPicList (params) {
    return http.get('/api/getthumimages/' + params)
  },
  async getGoodsList (params) {
    return http.get(`/api/getgoods?pageindex=${params}`)
  },
  async getGoodsInfo (params) {
    return http.get('/api/goods/getinfo/' + params)
  }
}
